package jhunter.context;

import jhunter.JHunterContainer;
import jhunter.security.JHunterSecurityManger;
import jhunter.security.PermissionCheck;
import jhunter.web.mvc.params.FlashManger;
import jhunter.web.mvc.view.ViewResovle;

import org.springframework.context.support.GenericXmlApplicationContext;

public class JHunterContext {

	private static final String appContext = "classpath:appContext.xml";

	private static GenericXmlApplicationContext context = new GenericXmlApplicationContext(appContext);

	public static ViewResovle getViewResovle() {
		return context.getBean(ViewResovle.class);
	}

	public static JHunterSecurityManger getJHunterSecurityManger() {
		return context.getBean(JHunterSecurityManger.class);
	}

	public static FlashManger getFlashManger() {
		return context.getBean(FlashManger.class);
	}

	public static PermissionCheck getPermissionCheck() {
		return context.getBean(PermissionCheck.class);
	}
	
	public static JHunterContainer getJHunterContainer() {
		return context.getBean(JHunterContainer.class);
	}

}
